<%@ page language="java" import="com.alibaba.fastjson.JSONArray" pageEncoding="utf-8"%>
<%@ page import="java.util.Map" %>

<%
  String pathPrefix = request.getContextPath();
    Map<String,Object> content = (Map<String, Object>)session.getAttribute("content");
    String shippingNoteNumber="";
    String companyPhone="";
    String companyName="";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <meta name="viewport" content="width=device-width,initial-scale=1">
  <link href="/static/css/style.css" type="text/css" rel="stylesheet" />
  <title>货物跟踪</title>
</head>
<body>
<div class="h-title">
  <div class="h-font">货物跟踪</div>
</div>
<div class="h-banner">
  <img class="h-banner-img" src="<%=pathPrefix%>/static/images/banner1.jpg" />
</div>
<div class="hw-foot">
  <div class="hw-foot-1">
    <div class="h-foot">
      <div class="hw-top">
        <div class="hw-left"></div>
        <div class="hw-right">
            <%
            if(content!=null&&content.size()>0){
                String list= content.get("list")+"";
                if(list!=null&&list!=""&&!"[]".equals(list)){

                JSONArray arr = JSONArray.parseArray(list);
                for(int i=0;i<arr.size();i++){
                    companyPhone=arr.getJSONObject(i).get("companyPhone")+"";
                    companyName = arr.getJSONObject(i).get("companyName")+"";
                    shippingNoteNumber= arr.getJSONObject(i).get("shippingNoteNumber")+"";
                    if(companyName!=null&&companyName!=""){
                        break;
                    }
                }
                %>
            <div class="h-h2">
                <%=companyName%>
            </div>
            <div class="h-p"> <%=companyPhone%>
            </div>
            <%
            }else{
              %>
            <div class="h-h2">

            </div>
            <div class="h-p">
            </div>
            <div class="hw-title"></div>
            <%
            }
            }else{
                %>



            <div class="hw-top">
                <div class="hw-right">
                    <div class="h-h2">暂无数据</div>
                    <div class="h-p"></div>
                </div>
            </div>


            <%
            }
            %>

        </div>
      </div>

        <%
            if(content!=null&&content.size()>0){
                String list= content.get("list")+"";
                if(list!=null&&list!=""&&!"[]".equals(list)){

                JSONArray arr = JSONArray.parseArray(list);
                for(int i=0;i<arr.size();i++){
                    String shippingNote         = arr.getJSONObject(i).get("shippingNote")+"";
                    String statusChangeDateTime = arr.getJSONObject(i).get("statusChangeDateTime")+"";
                    String trackStatusName      = arr.getJSONObject(i).get("trackStatusName")+"";
                    if(i==0){
                        if(shippingNote!=null&&shippingNote!=""){
                        %>
        <div class="hw-title">订单号码：<%=shippingNoteNumber%></div>
        <div class="hw-time">
            <div class="hw-t1">
                <div class="hw-img"><img src="/static/images/p9.png" /></div>
                <div class="hw-p">
                    <div class="hw-p0">【<%=trackStatusName%>】<%=shippingNote%></div>
                    <div class="hw-text"><%=statusChangeDateTime%></div>
                </div>
            </div>
        </div>
        <%
                        }
                    }else{
                            if(shippingNote!=null&&shippingNote!=""){
                                %>
        <div class="hw-time">
            <div class="hw-t1">
                <div class="hw-img"><img src="/static/images/p09.png" /></div>
                <div class="hw-p">
                    <div class="hw-p2">【<%=trackStatusName%>】<%=shippingNote%></div>
                    <div class="hw-text"><%=statusChangeDateTime%></div>
                </div>
            </div>
        </div>
        <%
                            }
                    }

                }
            }else{
                    %>
        <div class="hw-title">暂无订单货物跟踪记录</div>
        <%
                            }
            }
        %>
    </div>
  </div>
</div>
<div class="hw-xinxi">
  <div class="hw-x-x">飞扬软件技术有限公司提供技术支持</div>
</div>
</body>
</html>

